import request from '@/utils/request'

export function save_todo(data) {
  return request({
    url: '/api/dashboard/save_todo',
    method: 'post',
    data
  })
}

export function get_todo() {
  return request({
    url: '/api/dashboard/get_todo',
    method: 'get'
  })
}

export function del(id) {
  return request({
    url: '/api/article/delete',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/api/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
